extern "C" {
#include <stdio.h>
}
#ifndef __LOGGER_H__
#define __LOGGER_H__

namespace logger {
  void log(const char* level, const char* file, const int line, const char* fmt, ... );
}

// XXX 暫定措置
/*#define LOG(level, str) { \
    logger::log(level, str); \
  }

#define LOG(level, format, ...) { \
    logger::log(level, format, __VA_ARGS__); \
  }

#define ERROR(...) {\
    LOG("error", __VA_ARGS__); \
    abort(); \
  }*/

#define SYS_ERROR() {\
    logger::log("error", __FILE__, __LINE__, "%s", strerror(errno)); \
    abort(); \
  }

#endif
